<%@ page import="com.atkxp.pojo.Blog" %>
<%@ page import="java.util.List" %>
<%@ page import="com.atkxp.service.UserService" %>
<%@ page import="com.atkxp.pojo.User" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%--
  Created by IntelliJ IDEA.
  User: longhunpomie
  Date: 2022/10/30
  Time: 21:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<html>
<head>
    <title>首页</title>
    <%
        String basePath = request.getScheme() + "://" +
                request.getServerName() +
                ":" + request.getServerPort() +
                request.getContextPath() + "/";
        pageContext.setAttribute("basePath", basePath);
    %>
    <base href="<%=basePath%>"/>
    <link rel="shortcut icon" href="static/img/logo_chzu1.png" type="image/x-icon" />
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap.min.css">

    <!-- Latest compiled and minified JavaScript -->
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
    <jsp:include page="../../pages/common/indexScript.jsp"></jsp:include>
</head>
<body>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <jsp:include page="../../pages/common/head_index.jsp"></jsp:include>
            <jsp:include page="../../pages/common/remind.jsp"></jsp:include>
            <div class="carousel slide" id="carousel-689801">
                <ol class="carousel-indicators">
                    <li class="active" data-slide-to="0" data-target="#carousel-689801">
                    </li>
                    <li data-slide-to="1" data-target="#carousel-689801">
                    </li>
                    <li data-slide-to="2" data-target="#carousel-689801">
                    </li>
                </ol>
                <div class="carousel-inner">
                    <div class="item active">
                        <img alt="" src="static/img/chzu图片1.jpg" />
                        <div class="carousel-caption">
                            <h4>
                                滁院美景
                            </h4>
                        </div>
                    </div>
                    <div class="item">
                        <img alt="" src="static/img/chzu图片2.jpg" />
                        <div class="carousel-caption">
                            <h4>
                                图书馆
                            </h4>
                        </div>
                    </div>
                    <div class="item">
                        <img alt="" src="static/img/chzu图片3.jpg" />
                        <div class="carousel-caption">
                            <h4>
                                2022届新生毕业典礼
                            </h4>
                        </div>
                    </div>
                </div> <a data-slide="prev" href="#carousel-689801" class="left carousel-control">‹</a> <a data-slide="next" href="#carousel-689801" class="right carousel-control">›</a>
            </div>
            <c:forEach var="blog" items="${requestScope.blogs}">
                <li class="span2" style="height: 500px; width: 175px;">
                    <div class="thumbnail">
                        <c:if test="${blog.value.value.key.headImg != null}">
                            <img src="${basePath}user/img?name=${blog.key.userName}" style="width: 250px; height: 180px;border-radius: 50%;"/>
                        </c:if>
                        <c:if test="${blog.value.value.key.headImg == null}">
                            <img src="static/img/defaultHeadImg3.png" style="width: 250px; height: 180px;border-radius: 50%;" alt=""/>
                        </c:if>
                        <div class="caption" >
                            <h4 style="color: blue">
                                    ${blog.key.userName}
                            </h4>
                            <span style="color: grey">${blog.value.key}</span>
                            <span style="color:darkolivegreen;">&nbsp;&nbsp;浏览数:<font style="color: red">${blog.key.browsesNum}</font></span>
                            <h3>
                                    ${blog.key.blogHead}
                            </h3>
                            <p style="display: -webkit-box;   overflow: hidden;   white-space: normal!important;   text-overflow: ellipsis;   word-wrap: break-word;   -webkit-line-clamp: 5;   -webkit-box-orient: vertical;">
                                    ${blog.key.blogContent}
                            </p>
                            <p>
                                <a class="btn btn-primary" href="${basePath}/blog/showBlog?id=${blog.key.id}">浏览</a> <img src="static/img/CommentImg.png">${blog.value.value.value}</img><img src="static/img/like.png" style="width: 35px; height: 35px">${blog.key.likes}</img>
                            </p>
                        </div>
                    </div>
                </li>
            </c:forEach>
        </div>
    </div>
</div>
<jsp:include page="../../pages/common/page_nav.jsp"></jsp:include>
<jsp:include page="../../pages/common/footer.jsp"></jsp:include>
</body>
</html>
